package cn.gson.springboot.model.dao.saledao;

import cn.gson.springboot.model.pjos.Ctschemes;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface CtschemesDao extends CrudRepository<Ctschemes,Integer> {
//    查询回款
    @Query(nativeQuery = true,value = "select * from ctschemes where ct_customerid = ?1")
    public List<Ctschemes> selectCtchemes(Integer congId);

//    合并
    @Transactional
    @Modifying
    @Query(nativeQuery = true,value = "update ctschemes set ct_customerid = ?1 where ct_customerid = ?2")
    public void upCustomer(Integer daoId,Integer congId);
}
